import VueRouter from 'vue-router';

import HomeContainer from './components/tabbar/HomeContainer.vue';
import SortContainer from './components/tabbar/SortContainer.vue';
import ShopcarContainer from './components/tabbar/ShopcarContainer.vue';
import FindContainer from './components/tabbar/FindContainer.vue';
import UserContainer from './components/tabbar/UserContainer.vue';
import GoodsListContainer from './components/goods/GoodsListContainer.vue';
import GoodsInfoContainer from './components/goods/GoodsInfoContainer.vue';
// 3. 创建路由对象
var router = new VueRouter({
  routes: [
    { path: '/', redirect: '/home' },
    { path: '/home', component: HomeContainer },
    {
      path: '/sort', component: SortContainer
    },
    { path: '/shopcar', component: ShopcarContainer },
    { path: '/find', component: FindContainer },
    { path: '/user', component: UserContainer },
    { path: '/goodslist/phone', component: GoodsListContainer },
    { path: '/goodsinfo/:id', component: GoodsInfoContainer },
  ],
  linkActiveClass: 'mui-active'
})

// 把路由对象暴露出去
export default router